package com.ghy.service.impl;



import com.ghy.entity.EbOrder;
import com.ghy.mapper.OrderMapper;
import com.ghy.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderServicelmpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

  @Override
    public List<EbOrder> listByPage(int page, int pageSize) {
        int from = (page-1)* pageSize;
        return orderMapper.findByPage(from,pageSize);
    }

    @Override
    public Integer getMaxPage(Integer pageSize){
        return orderMapper.getMaxPage(pageSize);
    }


   @Override
    public EbOrder selectOne(Integer eoId){
        return orderMapper.selectOne(eoId);
    }

    @Override
    public int remove(int eoId) {
        return orderMapper.remove(eoId);
    }
    @Override
    public int updateOrder (EbOrder ebOrder){
        return orderMapper.updateByPrimaryKey(ebOrder);
    }

    @Override
    public List<EbOrder> listByNamePage(Integer page, Integer pageSize, String eoUserName) {
        return orderMapper.listByNamePage(page,pageSize,eoUserName);
    }

}
